﻿using System;
using System.Data;

namespace DTO
{
    /// <summary>
    /// Interface định nghĩa các thao tác trong chương trình
    /// </summary>
    /// <typeparam name="T">Đối tượng thực hiện</typeparam>
    public interface IBaseOperation<T>
    {
        /// <summary>
        /// Lấy toàn bộ danh sách đối tượng
        /// </summary>
        /// <param name="table">Tên bảng</param>
        /// <returns></returns>
        DataTable GetAllObject(string table);

        /// <summary>
        /// Thêm đối tượng
        /// </summary>
        /// <param name="procName">Tên procedure</param>
        /// <param name="commandType">Kiểu command</param>
        /// <param name="parameters">Danh sách biến và giá trị tương ứng</param>
        /// <returns></returns>
        int AddObject(string procName, CommandType commandType, params Object[] parameters);

        /// <summary>
        /// Sửa đối tượng
        /// </summary>
        /// <param name="procName">Tên procedure</param>
        /// <param name="commandType">Kiểu command</param>
        /// <param name="parameters">Danh sách biến và giá trị tương ứng</param>
        /// <returns></returns>
        int EditObject(string procName, CommandType commandType, params Object[] parameters);

        /// <summary>
        /// Xóa đối tượng
        /// </summary>
        /// <param name="procName">Tên procedure</param>
        /// <param name="commandType">Kiểu command</param>
        /// <param name="parameters">Danh sách biến và giá trị tương ứng</param>
        /// <returns></returns>
        int DeleteObject(string procName, CommandType commandType, params Object[] parameters);
    }
}